Skip to content

BH Config & Carousel -> PROD-2321 #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 8, 2022

Conversation

mmattlin
Copy link

@mmattlin mmattlin commented Jul 1, 2022

What's in this PR?

  • Adding the (initial) configuration settings for BH and then using these settings to display BH in the Start Work carousel.
  • Start Work tile is currently using the Find Me Data picture as a placeholder because I'm still waiting on the correct image from the UI/UX team. I will update the image as part of a separate PR.
  • You will see several TODOs throughout the code because there are certain configuration info we don't yet have or are not part of this story (i.e. pricing)

Screenshots

image

Copy link
Contributor

@brooketopcoder brooketopcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmattlin this looks great!!

The store is the code that actually talks to the data store, which in most cases is the API.

The factory takes the raw data from the store and transforms it into the model that the UI needs.

In your PR, the configs are really a data store. In this case, they are static config files, but I could see a future scenario where these come from an API instead.

So I think the configs should be in the work-store directory and should be accessed through the work.store.

And this means that the WorkPrices configs that I created should also be moved to the store.

Copy link
Contributor

@brooketopcoder brooketopcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Just a couple more comments...

@@ -258,10 +258,6 @@ function findPhase(challenge: Challenge, phases: Array<string>): ChallengePhase
// tslint:disable-next-line: cyclomatic-complexity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this tslint exclusion

@@ -258,10 +258,6 @@ function findPhase(challenge: Challenge, phases: Array<string>): ChallengePhase
// tslint:disable-next-line: cyclomatic-complexity
function getCost(challenge: Challenge, type: WorkType): number | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Factories should be really dumb--they just take data in one form and transform it to another.

Now that we're thinking of the configs as data, it means this getCost method is actually retrieving data directly from the store in the form of the price config, which is an anti-pattern.

Let's have the work-provider pass the WorkPrices config into the factory create method instead.

Copy link
Author

@mmattlin mmattlin Jul 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brooketopcoder Now I'm thinking of just returning the prices as part of the WorkTypeConfigs instead of a separate object and using that in the work.factory. Let me know if you see any issues with that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disregard that last comment. We can't do that unless we import the config for the other intakes as well. Maybe a future update

Copy link
Contributor

@brooketopcoder brooketopcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good.

I am seeing some other issues that I introduced with confusing the factory and the store directories.

I will make these changes in a separate ticket/PR and have you review them.

@mmattlin mmattlin changed the title [DO NOT MERGE] BH Config & Carousel -> PROD-2321 BH Config & Carousel -> PROD-2321 Jul 8, 2022
@mmattlin mmattlin merged commit f7d8efc into PROD-2321_bug-hunt-intake-form Jul 8, 2022
@mmattlin mmattlin deleted the PROD-2321_bh-carousel branch July 8, 2022 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants